home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 19 / Amiga Format CD19 (1997-10-02)(Future Publishing)(GB)(Track 1 of 5)[!][issue 1997-11].iso / -seriously_amiga- / shareware / gfxcard / cyberblanker / source-code / app.h < prev    next >
C/C++ Source or Header  |  1997-08-26  |  9KB  |  204 lines

  1.  
  2.    /***********************************************************************
  3.    *                                                                      *
  4.    *                            COPYRIGHTS                                *
  5.    *                                                                      *
  6.    *   Copyright (c) 1990  Commodore-Amiga, Inc.  All Rights Reserved.    *
  7.    *   This file was modified by © Zinneberg-Soft.                        *
  8.    ***********************************************************************/
  9.  
  10. #ifndef APP_H
  11. #define APP_H
  12. #include <clib/all_protos.h>
  13. #include <intuition/gadgetclass.h>
  14. #include <cybergraphics/cybergraphics.h>
  15. #include <proto/cybergraphics.h>
  16. #include <string.h>
  17. #include <stdlib.h>
  18.  
  19. /**********************************************************************/
  20. /* Prototypes for functions declared in app.c and called from the     */
  21. /* standard modules.                                                  */
  22. /**********************************************************************/
  23. VOID SSET_DPMS_SUSPEND(VOID);
  24. VOID SSET_DPMS_OFF(VOID);
  25. VOID SSET_DPMS_STANDBY(VOID);
  26. VOID setupCustomGadgets(struct Gadget **);
  27. VOID HandleGadget(ULONG,ULONG);
  28. VOID setupCustomMenu(VOID);
  29. VOID handleCustomMenu(ULONG code);
  30. VOID refreshWindow(VOID);
  31. BOOL setupCustomCX(VOID);
  32. VOID shutdownCustomCX(VOID);
  33. VOID handleCustomCXMsg(ULONG);
  34. VOID handleCustomCXCommand(ULONG);
  35. VOID handleCustomSignal(VOID);
  36.  
  37. /**********************************************************************/
  38. /* Prototypes for functions declared in the standard modules and      */
  39. /* called by app.c                                                    */
  40. /**********************************************************************/
  41. VOID setupWindow(VOID);
  42. VOID shutdownWindow(VOID);
  43. VOID terminate(VOID);
  44.  
  45. /**********************************************************************/
  46. /* Prototypes for functions declared in application modules and       */
  47. /* called by app.c                                                    */
  48. /**********************************************************************/
  49. BOOL setupBlanker(void);
  50. VOID mysetupCustomGadgets(struct Gadget **gad);
  51. VOID myHandleGadget(ULONG gad,ULONG code);
  52. VOID MyHandleCustomSignal(VOID);
  53. VOID SHOWABOUT(VOID);
  54. VOID SHOWCONFIG(VOID);
  55. /**********************************************************************/
  56. /* definitions for global variables declared in the standard modules  */
  57. /* referenced by app.c                                                */
  58. /**********************************************************************/
  59. extern CxObj                  *broker;
  60. extern SHORT                  topborder;
  61. extern VOID                   *vi;
  62. extern struct Menu            *menu;
  63. extern struct Library         *GadToolsBase;
  64. extern struct Gadget          *glist;
  65. extern char                   **ttypes;
  66. extern struct MsgPort         *cxport;
  67. extern struct IntuitionBase   *IntuitionBase;
  68. extern struct DrawInfo        *mydi;
  69. extern ULONG                  csigflag;
  70. extern struct Task            *maintask;
  71. extern BOOL                   IDCMPRefresh;
  72. extern struct EasyStruct aboutcybereasy;
  73. extern struct EasyStruct progconfig;
  74.  
  75. /**********************************************************************/
  76. /* definitions for global variables declared in app.c and             */
  77. /* referenced by the standard modules.                                */
  78. /**********************************************************************/
  79. /* extern struct TextAttr mydesiredfont;  */
  80.  
  81. /**********************************************************************/
  82. /* Commodities specific definitions.                                  */
  83. /*                                                                    */
  84. /* COM_NAME  - used for the scrolling display in the Exchange program */
  85. /* COM_TITLE - used for the window title bar and the long description */
  86. /*             in the Exchange program                                */
  87. /* COM_DESC  - Commodity description used by the Exchange program     */
  88. /* CX_DEFAULT_PRIORITY - default priority for this commodities broker */
  89. /*                       can be overidden by using icon TOOL TYPES    */
  90. /**********************************************************************/
  91. #define COM_NAME  "CyberBlanker "
  92. #define COM_TITLE "CyberBlanker"  /* goes in window */
  93. #define COM_DESCR "©97 Zinneberg-Soft"
  94. #define CX_DEFAULT_PRIORITY 0
  95. #define CX_DEFAULT_POP_KEY ("shift f1")
  96. #define CX_DEFAULT_POP_ON_START ("YES")
  97.  
  98. /**********************************************************************/
  99. /* Custom Signal control                                                     */
  100. /*                                                                    */
  101. /* If CSIGNAL = 0 then this commodity will NOT have a custom signal   */
  102. /* If CSIGNAL = 1 this commodity will support a custom signal         */
  103. /**********************************************************************/
  104. #define CSIGNAL 1
  105.  
  106. /**********************************************************************/
  107. /* Window control                                                     */
  108. /*                                                                    */
  109. /* If WINDOW = 0 then this commodity will NOT have a popup window     */
  110. /* If WINDOW = 1 this commodity will support a popup window with the  */
  111. /*               attributes defined below.                            */
  112. /**********************************************************************/
  113. #define WINDOW 1
  114. #define CYBER68060     0
  115. #define CYBER680203040 1
  116. #if WINDOW
  117. #define W(x) x
  118. #else
  119. #define W(x) ;
  120. #endif
  121.  
  122. #if WINDOW
  123.  
  124. extern struct Window   *window;
  125. extern struct TextFont *font;
  126.  
  127. #define WINDOW_LEFT   134
  128. #define WINDOW_TOP    64
  129. #define WINDOW_WIDTH  250
  130. #define WINDOW_HEIGHT 80
  131. #define WINDOW_INNERHEIGHT 100
  132.  
  133. #define WINDOW_SIZING 0
  134. #if WINDOW_SIZING
  135. #define WINDOW_MAX_WIDTH  -1
  136. #define WINDOW_MIN_WIDTH  150
  137. #define WINDOW_MAX_HEIGHT -1
  138. #define WINDOW_MIN_HEIGHT 130
  139. #define WFLAGS (ACTIVATE | WINDOWCLOSE | WINDOWDRAG | WINDOWSIZING | WINDOWDEPTH | SIMPLE_REFRESH )
  140. #else
  141. #define WINDOW_MAX_WIDTH  WINDOW_WIDTH
  142. #define WINDOW_MIN_WIDTH  WINDOW_WIDTH
  143. #define WINDOW_MAX_HEIGHT WINDOW_HEIGHT
  144. #define WINDOW_MIN_HEIGHT WINDOW_HEIGHT
  145. #define WFLAGS (ACTIVATE | WINDOWCLOSE | WINDOWDRAG | WINDOWDEPTH | SIMPLE_REFRESH )
  146. #endif  /* WINDOW_SIZING */
  147.  
  148. #define IFLAGS (MENUPICK | MOUSEBUTTONS | GADGETUP | GADGETDOWN | MOUSEMOVE | CLOSEWINDOW | REFRESHWINDOW )
  149.  
  150.                                      /* hotkey definitions                */
  151. #define POP_KEY_ID     (86L)         /* pop up identifier                 */
  152.  
  153. /**********************************************************************/
  154. /* Gadget control                                                     */
  155. /*                                                                    */
  156. /* Here are the gadget specific definitions. Note that these are      */
  157. /* included only if WINDOW=1 since gadgets make no sense without a    */
  158. /* window.                                                            */
  159. /**********************************************************************/
  160. #define GAD_HIDE     1
  161. #define GAD_DIE      2
  162. #define GAD_SECS     3
  163. #define GAD_DPMS_STANDBY   4
  164. #define GAD_DPMS_SUSPEND   5
  165. #define GAD_DPMS_OFF       6
  166. #define GAD_CYCLE       7
  167. /**********************************************************************/
  168. /* Menu control                                                       */
  169. /*                                                                    */
  170. /* Here are the menu specific definitions. Note that these are        */
  171. /* included only if WINDOW=1 since menus make no sense without a      */
  172. /* window.                                                            */
  173. /**********************************************************************/
  174. #define MENU_HIDE     1
  175. #define MENU_DIE      2
  176. #define SHOW_ABOUT    3
  177. #define SHOW_V        4
  178. #define SHOW_H        5
  179. #define SHOW_V_H      6
  180. #define CONFIG        7
  181. #endif  /* WINDOW */
  182.  
  183. /**********************************************************************/
  184. /* Debug control                                                      */
  185. /*                                                                    */
  186. /* The first define converts any printfs that got in by mistake into  */
  187. /* kprintfs. If you are debuging to the console you can change        */
  188. /* kprintfs into printfs.                                             */
  189. /* The D1(x) define controls debugging in the standard modules. Use   */
  190. /* The D(x) macro for debugging in the app.c module.               */
  191. /**********************************************************************/
  192. void kprintf(char *,...);
  193. #define printf kprintf
  194.  
  195. #ifdef DEBUG
  196. #define D1(x) x
  197. #define D(x)  x
  198. #else
  199. #define D1(x) ;
  200. #define D(x)  ;
  201. #endif /* NO DEBUG */
  202.  
  203. #endif /* APP_H */
  204.